
class Student{
    public int a;
    public void add(){
        this.a=this.a+1;
    }
}
public class Test08 {
    public static void main(String[] args) throws InterruptedException {
        Student student = new Student();

        Thread thread = new Thread(()->{
            for(int i = 0;i<5000;i++){
                student.add();
           
            }
        });
        Thread thread1 = new Thread(()->{
            for(int i = 0;i<5000;i++){
                student.add();
            }
        });
        thread.start();
        thread1.start();
        thread.join();
        thread1.join();
        System.out.println(student.a);
    }
}
